<extend name="desktop_default/template/user/base_user" />
<block name="area_header">
    <link rel="stylesheet" href="__CSS__/user/service/style.css">
</block>

<block name="area_top">

</block>
<block name="user_top">

</block>
<block name="main_content">
    <div class="service">
        <div class="user-tab">
            <a class="selected default" href="javascript:void(0);">申请售后</a>
        </div>
        <empty name="result">
            <div class="service-type">
                <div class="type">
                    <div class="title">
                        <h4>申请服务：{$type_desc}</h4>
                    </div>
                    <div class="service-form">
                        <form method="post" action="__SELF__">
                            <div class="form-group">
                                <label for="reason">{$type_desc}原因:*</label><input id="reason" type="text" name="reason">
                            </div>
                            <in name="type_desc" value="退货退款,仅退款">
                                <div class="form-group">
                                    <label for="money">退款金额:*</label><input id="money" class="input-money" type="text" name="money">（最多<em class="price">{:number_format($detail['price']-$detail['discount_money'],2,'.','')}</em>元，含发货邮费<em class="price">{$detail.post_price}</em>元）
                                </div>
                            </in>
                            <div class="form-group">
                                <label for="note">说明:</label><input id="note" type="text" name="note">
                            </div>
                            <div class="form-group">
                                <label></label>
                                <button type="submit" class="btn apply" onclick="return check()">提交申请</button>
                                <a class="btn apply" href="javascript:history.go(-1);">取消并返回</a>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="order-info">
                    <p>联系客服：<a class="btn kefu" href="javascript:void(0);">联系客服</a></p>
                    <p>订单编号：{$detail.order_code}</p>
                    <p>订单总价：<em class="price">{$detail.price}</em>元</p>
                    <p>实际付款：<em class="price">{:number_format($detail['price']-$detail['discount_money'],2,'.','')}</em>元</p>
                </div>
            </div>
        </empty>
        <notempty name="result">
            <div class="result">
                <h2>{$result}</h2>
                <a class="btn btn-back" href="{:U('mengwu/user/order_detail',array('order_code'=>$detail['order_code']))}">返回</a>
            </div>
        </notempty>
        <div class="tip-box">
            <div class="title">
                <h4>服务介绍</h4>
            </div>
            <div class="content">
                <eq name="type_desc" value="仅退款">
                    <dl>
                        <dt>1.仅退款</dt>
                        <dd>申请条件：若您未收到货，或已收到货且与萌屋达成一致不退货仅退款时，请选择“仅退款”选项。</dd>
                        <dd>退款流程：1.申请退款 > 2. 萌屋同意退款申请>3.退款成功</dd>
                    </dl>
                </eq>
                <eq name="type_desc" value="退货退款">
                    <dl>
                        <dt>2.退货退款</dt>
                        <dd>申请条件：若为商品问题，或者不想要了且与萌屋达成一致退货，请选择“退货退款”选项，退货后请保留物流底单（闲置商品和未加入消保商品仅支持未收到货的退款）。</dd>
                        <dd>退货流程：1.申请退货 >2.萌屋发送退货地址给买家 >3.买家退货并填写退货物流信息 >4.萌屋确认收货，退款成功</dd>
                    </dl>
                </eq>
                <eq name="type_desc" value="换货">
                    <dl>
                        <dt>3.换货</dt>
                        <dd>申请条件：若您与萌屋协商一致换货，请选择“换货”选项，退货后请保留物流底单。</dd>
                        <dd>换货流程：1.申请换货 >2.卖家发送退货地址给买家 >3.买卖家线下完成换货 >4.买家线上确认完成</dd>
                    </dl>
                </eq>
            </div>
        </div>
    </div>

</block>
<block name="area_footer">
    <script type="text/javascript">
        function check(){
            var reason = $('#reason');
            var money = $('#money');
            var note = $('#note');
            if($.trim(reason.val())==''){
                alert('必须填写原因');
                reason.focus();
                return false;
            }
            if(parseFloat(money.val())<0){
                alert('退款金额必须为大于等于0的数字');
                money.focus();
                return false;
            }
            return true;
        }
    </script>
</block>
